using System;
using System.Collections.Generic;
using System.Text;
using QLKS.HeThongBUS;
using QLKS.HeThongDAO;
using System.Data;

namespace QLKS.HeThongBUS
{
    
    public enum PH_BUSResult
    {
        OK,
        DAOERROR,
    }



    public class PH_BUS
    {

        //Duong
        public static PH_BUSResult ThemLoaiPhong(PH_DTO LP)
        {
            if (!PH_DAO.Insert(LP))
                return PH_BUSResult.DAOERROR;
            return PH_BUSResult.OK;
        }

        public static PH_BUSResult UpdateLoaiPhong(PH_DTO LP)
        {
            if (!PH_DAO.UpdateLP(LP))
                return PH_BUSResult.DAOERROR;
            return PH_BUSResult.OK;
        }

        public static PH_BUSResult DeleteLoaiPhong(PH_DTO LP)
        {
            if (!PH_DAO.DeleteLP(LP))
                return PH_BUSResult.DAOERROR;
            return PH_BUSResult.OK;
        }



        //Hai
        public static DataTable DSLoaiPhong()
        {
            return PH_DAO.SelectAllLoaiPH();
        }

        public static DataTable DSPhong()
        {
            return PH_DAO.SelectAllDSPhong();
        }

        public static DataTable DSPhongTrong()
        {
            return PH_DAO.SelectAllDSPhongTrong();
        }

        public static DataTable TraCuuPhong(string dk1,string dk2 ,string dk3)
        {
            return PH_DAO.Tracuuphong(dk1,dk2,dk3);
        }



        #region Quan Ly P
        public static PH_BUSResult ThemPhong(PH_DTO ph)
        {
            if (!PH_DAO.InsertPH(ph))
                return PH_BUSResult.DAOERROR;
            return PH_BUSResult.OK;
        }

        public static PH_BUSResult UpdatePhong(PH_DTO ph)
        {
            if (!PH_DAO.UpdatePH(ph))
                return PH_BUSResult.DAOERROR;
            return PH_BUSResult.OK;
        }

        public static PH_BUSResult DeletePhong(PH_DTO ph)
        {
            if (!PH_DAO.DeletePH(ph))
                return PH_BUSResult.DAOERROR;
            return PH_BUSResult.OK;
        }


        #endregion

    }
}
